﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="felixfinalproject2._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

</asp:Content>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder4">
    <div id="reptr" style="width:78%; height:26px; float:left;">
 <asp:Repeater ID="Repeater1" runat="server" 
        DataSourceID="SqlDataSource1">
        <ItemTemplate>
        | 
        <a href="Default.aspx?Tagname=<%#Eval("tagname")%>">
        <%# Eval("tagname")%>
        </a> |
        </ItemTemplate>
     </asp:Repeater>
     <a href="Default.aspx">Show All</a>        
  </div>
  <div id="search" style="width:21%; float:right; height: 26px;">
      <asp:TextBox ID="TextBox1" runat="server" Width="90px" Height="18px" 
          ToolTip="Search by tagname"></asp:TextBox>&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" Text="Search" Height="23px" 
          Width="60px" />
        </div>
         <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:mercedesbenzconnectionstring %>" 
        ProviderName="<%$ ConnectionStrings:mercedesbenzconnectionstring.ProviderName %>" 
        SelectCommand="SELECT [tagname] FROM [tags]"></asp:SqlDataSource>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
    <br/>
    
    <br/> <div style ="margin:auto; width: 705px;"><p align="center"><marquee>Welcome to the Mercedes Benz AMG 
        website.</marquee> </p><center>
        <p align="center">All the details about Mercedes Benz AMG cars are displayed on this 
            Website. To have full Access to everything that happens in this site, you have 
            to own an account. Click this link to open an account.&nbsp; As a Visitor you 
            can only view the Available cars below this text. To be able to create events, 
            upload new cars, make comments, view all users, like cars and rate cars and do 
            even more, you 
            have to be a member.</p>
        <p align="center"><a href="Account/Register.aspx">click this link to create profile for website full access</a></p></div>
    <p align="center">
    <asp:Button ID="btn_showgrid" runat="server" Text="Show Cars" Height="26px" 
            Width="88px" />
        <asp:Button ID="btn_close" runat="server" Text="Hide Cars" />
        <br/>
        <asp:PlaceHolder ID="gridzone" runat="server">
         <asp:Label ID="Label1" runat="server" Text="LIST OF ALL AMG CARS AVAILABLE ON WEBSITE "></asp:Label>
    </p> <br/>
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" CssClass="datagrid" Height="20px" Width="341px" 
            DataSourceID="mercedesbenzdatasource" >
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="details.aspx?ID={0}" DataTextField="model" 
                HeaderText="Model" SortExpression="model" />
            <asp:BoundField DataField="body_type" HeaderText="body_type" 
                SortExpression="body_type" />
            <asp:ImageField DataImageUrlField="car_picture" HeaderText="Thumbnail">
                <ControlStyle CssClass="carpictures" Height="150px" Width="200px" />
            </asp:ImageField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="mercedesbenzdatasource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:mercedesbenzconnectionstring %>" 
        ProviderName="<%$ ConnectionStrings:mercedesbenzconnectionstring.ProviderName %>" 
        
        SelectCommand="SELECT [model], [production_year], [body_type], [price], [features], [official_site_link], [car_picture], [michelin_stars], [ID] FROM [cars] ORDER BY [ID] DESC">
    </asp:SqlDataSource>


    <asp:SqlDataSource ID="mercedesbenzdatasource0" runat="server" 
        ConnectionString="<%$ ConnectionStrings:mercedesbenzconnectionstring %>" 
        ProviderName="<%$ ConnectionStrings:mercedesbenzconnectionstring.ProviderName %>" 
        
        
                
                SelectCommand="SELECT DISTINCT [model], [tagname], [production_year], [ID], [price], [body_type], [features], [car_picture], [official_site_link], [michelin_stars] FROM [tagcarview] WHERE ([tagname] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="tagname" QueryStringField="tagname" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>     
    </asp:PlaceHolder ></center>
</asp:Content>

